package com.galengao.springboot.eventlistener.listener;

import com.galengao.springboot.eventlistener.dto.SimpleMailDto;
import com.galengao.springboot.eventlistener.event.MailEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author galenGao
 * @version Id: MailListener.java, v 0.1 2022/7/21 23:37  GalenGao Exp $$
 */
@Slf4j
@Component
public class MailListener implements ApplicationListener<MailEvent> {


    @Override
    public void onApplicationEvent(MailEvent event) {
        SimpleMailDto mailDto = event.getSimpleMailDto();
        log.info("发送邮件......,邮件内容：{}",mailDto.toString());
        // TODO 此处省略发送邮件的逻辑
    }
}
